﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class WebMaster_Controls_Sitemap : System.Web.UI.UserControl
{
    ClassExecute.ClassExecute dt;
    string str = webapp4U.Configuration.CurrentConnectionString;
    static string error = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["Lang"].ToString().ToLower() == "en-us")
            {
                SiteMapPath1.SiteMapProvider = "en";
            }
            else
            {
                SiteMapPath1.SiteMapProvider = "vi";
            }   
        }
    }

    private bool IsWildcardMatch(String wildcard, String text, bool casesensitive)
    {
        System.Text.StringBuilder sb = new System.Text.StringBuilder(wildcard.Length + 10);
        sb.Append("^");
        for (int i = 0; i < wildcard.Length; i++)
        {
            char c = wildcard[i];
            switch (c)
            {
                case '*':
                    sb.Append(".*");
                    break;
                default:
                    sb.Append(System.Text.RegularExpressions.Regex.Escape(wildcard[i].ToString()));
                    break;
            }
        }
        sb.Append("$");

        System.Text.RegularExpressions.Regex regex;
        if (casesensitive)
            regex = new System.Text.RegularExpressions.Regex(sb.ToString(), System.Text.RegularExpressions.RegexOptions.None);
        else
            regex = new System.Text.RegularExpressions.Regex(sb.ToString(), System.Text.RegularExpressions.RegexOptions.IgnoreCase);

        return regex.IsMatch(text);
    }

   
}
